package com.jiaok.controller;

import com.jiaok.annotation.EnterPathParamLog;
import com.jiaok.comm.CommonResponse;
import com.jiaok.model.param.UserParam;
import com.jiaok.service.ILoginService;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author jiaok
 * @Date 2023/5/8 16:35
 */
@RestController
@RequestMapping("/user")
public class LoginController  {

    @Resource
    private ILoginService iLoginService;

    @PostMapping("/login")
    @EnterPathParamLog
    public CommonResponse login(@RequestBody UserParam userParam){
        return iLoginService.login(userParam);
    }

    @PostMapping("/loginOut")
    public CommonResponse loginOut(){


        return iLoginService.loginOut();
    }

}
